LIBC_VER  = $(shell ls /lib/libc-*.so | cut -c11-13)  

CPP_FILE = *.cpp
TAR = ./clib_ini.a

INC_TOOL   = 
LNK_TOOL   = 
  
INC_MYSQL  = 
LNK_MYSQL  = 
  
INC = $(INC_TOOL) $(INC_MYSQL) -I./
LNK = $(LNK_TOOL) $(LNK_MYSQL) -lz

CPP = $(wildcard $(CPP_FILE))
OBJ = $(patsubst %.cpp,%.o,$(CPP)) 
LINK_OBJ = $(patsubst %.cpp,%.o,$(notdir $(CPP)))
  
all: $(TAR)  
  
$(TAR): $(OBJ)  
	@ar cru $@ $(LINK_OBJ)
	@echo $@  
	rm -f *.o  
  
%.o: %.cpp  
	@g++ -Wall -fPIC -g -c $*.cpp $(INC)  
	@echo $@  
  
clean:   
	rm -f *.o  
	rm $(TAR)

install:   
	cp *.h /usr/local/build/include/
	cp *.a /usr/local/build/lib/